<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
  <style>
    #box{
      height: 600px;
   
    }
    .green{
      background-color: aquamarine;
    }
    .black{
      background-color: black;
    }
  </style>
</head>
<body>
  <div id="box" :class="isColor?'green':'black'">
    <button @click="cut">切换</button>
  </div>
  <script>
    var box = new Vue({
      el:'#box',
      data:{
      isColor:true
      },
      methods:{
       cut(){
        console.log(666);
        box.isColor = !this.isColor
       }
      }
    })
  </script>
  <!-- 指令 ：是带有v-前缀的特殊属性
       v-bind 动态绑定属性
       v-if 动态创建/删除
       v-show 动态显示/隐藏
       v-on:click绑定事件
       v-for 遍历
       v-model 双向绑定表单
       缩写
       b-bind：src => :src
       v-on:click => @click
  
  
  
  
  
  -->
</body>
</html>